SynchronizedQueue

Ecng.Collections

Provides a thread-safe queue based on the QueueEx collection.

継承元: SynchronizedCollection<T, QueueEx<T>>

コンストラクター

SynchronizedQueue
public SynchronizedQueue()
synchronizedQueue = SynchronizedQueue()

Initializes a new instance of the SynchronizedQueue class.

メソッド

Dequeue
public T Dequeue()
result = synchronizedQueue.Dequeue()

Removes and returns the item at the beginning of the queue in a thread-safe manner.

戻り値: The item that was removed from the queue.

Enqueue
public void Enqueue(T item)
synchronizedQueue.Enqueue(item)

Adds an item to the queue in a thread-safe manner.

item
The item to enqueue.
OnGetItem
protected override T OnGetItem(int index)
result = synchronizedQueue.OnGetItem(index)

Throws a NotSupportedException as this operation is not supported for a queue.

index
The index of the item to retrieve.

戻り値: This method always throws an exception.

OnIndexOf
protected override int OnIndexOf(T item)
result = synchronizedQueue.OnIndexOf(item)

Throws a NotSupportedException as this operation is not supported for a queue.

item
The item to locate in the queue.

戻り値: This method always throws an exception.

OnInsert
protected override void OnInsert(int index, T item)
synchronizedQueue.OnInsert(index, item)

Throws a NotSupportedException as this operation is not supported for a queue.

index
The index at which the item should be inserted.
item
The item to insert.
OnRemoveAt
protected override void OnRemoveAt(int index)
synchronizedQueue.OnRemoveAt(index)

Throws a NotSupportedException as this operation is not supported for a queue.

index
The index of the item to remove.
Peek
public T Peek()
result = synchronizedQueue.Peek()

Returns the item at the beginning of the queue without removing it, in a thread-safe manner.

戻り値: The item at the beginning of the queue.